-
-
Notifications
You must be signed in to change notification settings - Fork 429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add sitemap Input type #3398
add sitemap Input type #3398
Conversation
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
I am a little surprised that nothing else than the sitemap syntax needs to be updated. |
I was surprised as well. But all the required code is automatically generated from the syntax, and that just works. There is more additional code for Basic UI in the webui repository, but still not a lot. |
An update of the documentation will of course be required. |
Of course. |
You can access BasicUI (and other UIs) from MainUI through the "icon at top right" (don't know how it is properly described). |
I have created a minimal documentation update, and will keep a broader update for later. |
Great @mherwege ! If you could add support for DateTime input as well, I think many users will be happy as it then allows for simple scheduling of tasks (in combination with a rule). |
Next on my list, but will be in another PR, and not sure how to do it yet. Material Design Lite does not have a pre-defined calendar and time input widget, and the default html data/time entry is not very good. In the main UI, that could be solved with a vue datepicker, but that's not an option here. I think it will have to be another input type to make it easier to handle in the mobile apps, where better support is available. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks.
No reason to do that, we (as in: mobile apps people) can check the item type for choosing the correct widget. |
That’s great. What about a parameter for date/time? In some cases, the time is the only thing to be updated (e.g. to update a daily schedule). Other cases you may only want to update the date. So I would thing there needs to be a parameter for that. What do you think? |
openhab/openhab-core#3398 added an Input element to sitemaps. This adds support for configuring this element to MainUI. A PR for BasicUI to support input elements is in progress (#1729). Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
That may be a good idea. In the case of the Android app, there's no date/time picker in Material Design 3 anyway, just date pickers and time pickers, but still, with an appropriate hint one could show either one, or both. |
Since that is essentially content description of the item it should be handled in item metadata. |
IMHO it isn't. It's presentation, similar to e.g. Slider min/max/step values, where one could argue to use the item's min/max/step values. The same thing here: why should there only be one possible presentation for a given item and not the choice of keeping date/time combined in one place and keeping it separate in another? A similar thing exists for Sliders, where people want different behaviors (apply during dragging vs. apply on release), but using item metadata for that is conceptually wrong because the option is about the presentation layer, not the item. |
Should it be possible to change the unit of measurement of |
The implementation in Basic UI allows changing the UOM. And Basic UI does not impact keyboard layout on mobile. This might be another candidate for an inputHint value. If set to number or no UOM present in the numeric value, it would present a numeric keyboard, if not, present a default keyboard. |
For information |
Depends on [PR #3398](openhab/openhab-core#3398) This adds support for an input widget in Basic UI. See Core PR for more extensive description. --------- Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
This pull request has been mentioned on openHAB Community. There might be relevant details there: |
So far, it has not been possible to have text or numeric input in a sitemap. This can be useful to do simple updating of items, for instance for manual meter readings.
The workaround so far has been to use a Webview element and some javascript, see forum: https://community.openhab.org/t/input-field-for-number-free-text-for-openhab-uis/12461.
This PR adds an sitemap input widget. A second PR will add this to Basic UI.
If these PR's would be accepted, I will also update the main UI sitemap configuration pages to include the input widget. I have not done any app development (Android, IOS) so far, but would hope this is interesting enough for someone to also consider adding it to the apps.
Some configuration options could definitely be added in follow-up PR's for the input field, but my testing shows it is already working well in Basic UI for String, Number and QuantityType items.